#pragma once

using namespace System;
using namespace System::Diagnostics;
using namespace System::Collections::Generic;
using namespace System::Windows::Threading;
using namespace TFlex;
using namespace TFlex::Model;

#pragma unmanaged

class OpenGLRender;

#pragma managed

namespace TFlex
{
	private ref class RenderPlugin : public TFlex::Plugin
	{
	public:
		RenderPlugin(PluginFactory^ factory);
		
	protected:
		void OnInitialize() override;
		void OnExited() override;
		void OnCreateTools() override;
		void OnCommand(CommandEventArgs^) override;

		void DocumentOpenEventHandler(DocumentEventArgs^) override;
		void NewDocumentCreatedEventHandler(DocumentEventArgs^) override;
		void DocumentRegeneratedEventHandler(RegenerateDocumentEventArgs^) override;

		void ViewCreatedEventHandler(ViewEventArgs^) override;
		void ClosingDocumentEventHandler(DocumentEventArgs^) override;

		void OnIdle(Object^ sender, EventArgs^);

	private:
		OpenGLRender* _render;
	};
}